<?php

class User_Form_Login extends Custom_Form
{

    public function init()
    {
		$translate = Zend_Registry::get('translate');
		$this->setTranslator($translate);

        $this->setName("login");
        $this->setMethod('post');

        $this->addElement('text', 'email', array(
            'filters'    => array('StringTrim', 'StringToLower'),
            'validators' => array(
                array('StringLength', false, array(0, 75)),
            ),
            'required'   => true,
            'label'      => __('Email').':',
        ));

        $this->addElement('password', 'password', array(
            'filters'    => array('StringTrim'),
            'validators' => array(
                array('StringLength', false, array(0, 50)),
            ),
            'required'   => true,
            'label'      => __('Password').':',
        ));

//		$this->addElement('checkbox', 'rememberMe', array(
//            'required' => false,
//			'label' => __('Remember me')));

        $this->addElement('submit', 'login', array(
            'required' => false,
            'ignore'   => true,
            'label'    => __('Login'),
        ));

		$this->login->removeDecorator('label');

		$this->email->addErrorMessage('ERR_LOGIN_EMAIL_REQUIRED');
		$this->password->addErrorMessage('ERR_LOGIN_PASSWORD_REQUIRED');
    }
}

